﻿namespace WMS6.Web.Common
{
    using System;
    using System.Collections.Generic;
    using System.Text;
    using WMS6.Web;
    using WMS6.Web.CommonMethodServiceRef;

    public class LocationShowAjax : BasePage
    {
        private int DivCount = 0;
        private string DivType = "";
        private int RowsCount = 0;
        private int SequenceNumber = 0;
        private string ShowEffect = "";
        private List<string> strColorList = new List<string> { "areaA", "areaB", "areaC", "areaD", "areaE", "areaF", "areaG", "areaH", "areaI", "areaJ", "areaK", "areaL" };
        private string[] strLocArray = new string[] { 
            "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", 
            "D", "H", "I", "G", "K", "M", "L", "N", "O", "P", "Q", "R", "S", "T", "U", "V", 
            "W", "X", "Y", "Z"
         };
        private List<string> StrTierList = new List<string>();
        private StringBuilder strZoneColor = new StringBuilder();
        private int TierCount = 0;

        private void AssignFunctionResponse(string StrHtml)
        {
            string strType = base.Request.QueryString["TYPE"];
            base.Response.Clear();
            base.Response.StatusCode = 200;
            base.Response.StatusDescription = "OK";
            base.Response.ContentType = "text/html";
            base.Response.Write(strType + "@_@" + StrHtml);
            base.Response.Flush();
            base.Response.End();
            base.Response.Close();
        }

        private int ConvertToIntByValue(string value)
        {
            for (int i = 0; this.strLocArray.Length > i; i++)
            {
                if (this.strLocArray[i] == value)
                {
                    return i;
                }
            }
            return 0;
        }

        private string ConvertToStringByIndex(int Index)
        {
            return this.strLocArray[Index].ToString();
        }

        private void GetLocDataByWh()
        {
            List<VisualLocationInfo> VisualLocation = this.Session["VisualLocSession"] as List<VisualLocationInfo>;
            if (VisualLocation.Count > 0)
            {
                if (this.ShowEffect == "Solid")
                {
                    this.SolidZoneHtmlCreate(VisualLocation);
                }
                else
                {
                    this.ZoneHtmlCreate(VisualLocation);
                }
            }
            else
            {
                this.AssignFunctionResponse("@_@<center  style=\"color:Red\">" + base.GetGlobalMsgResource("C014") + "</center>");
            }
        }

        private void GetPublicLocData()
        {
            VisualLocationQueryEntity visualLocQuery = new VisualLocationQueryEntity {
                Loc = base.Request.QueryString["QueryLocID"],
                SkuID = base.Request.QueryString["QuerySkuID"],
                Status = base.Request.QueryString["QueryStatus"],
                ZoneID = base.Request.QueryString["QueryZoneID"],
                OwnerID = base.Request.QueryString["QueryOwnerID"],
                Lot = base.Request.QueryString["QueryLot"],
                Lpn = base.Request.QueryString["QueryLpn"]
            };
            List<VisualLocationInfo> VisualLocation = CommoneMethodServiceClientProxy.GetInstance().GetAllVisualLocationInfo(visualLocQuery);
            this.Session.Remove("VisualLocSession");
            this.Session.Add("VisualLocSession", VisualLocation);
        }

        private void GetSkuDataById(string LocID)
        {
            VisualLocationInfo visualLoc = (this.Session["VisualLocSession"] as List<VisualLocationInfo>).Find(x => x.Loc == LocID);
            StringBuilder strDiv = new StringBuilder();
            strDiv.AppendFormat("<table width=\"500\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tr><td height=\"34\" background=\"../Images/slotbg_01.gif\"><table width=\"94%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><span class=\"warehoustitle\">{0}</span></td><td width=\"16\" class=\"close\" onclick=\"LocAndSkuClose();\">&nbsp;</td>  </tr></table></td></tr>", base.GetGlobalMsgResource("F5400_005"));
            strDiv.Append("<tr><td height=\"22\" background=\"../Images/slotbg_03.gif\"><table width=\"90%\" border=\"0\" align=\"center\" cellpadding=\"2\" cellspacing=\"0\"><tr>");
            strDiv.AppendFormat("<td width=\"10%\" class=\"areaname\">{2}：</td><td class=\"areamessage\">{0}</td><td width=\"15%\" class=\"areaname\">{3}：</td> <td class=\"areamessage\">{1}</td></tr>", new object[] { visualLoc.ZoneID, visualLoc.LocCategory, base.GetGlobalMsgResource("F5400_006"), base.GetGlobalMsgResource("F5400_007") });
            strDiv.AppendFormat("   <tr><td class=\"areaname\">{2}：</td><td class=\"areamessage\">{0}</td><td class=\"areaname\">{3}：</td><td class=\"areamessage\">{1}</td></tr>", new object[] { visualLoc.Loc, visualLoc.LocFlag, base.GetGlobalMsgResource("F5400_008"), base.GetGlobalMsgResource("F5400_009") });
            strDiv.AppendFormat("  <tr><td class=\"areaname\">{2}：</td><td class=\"areamessage\">{0}</td><td class=\"areaname\">{3}：</td><td class=\"areamessage\">{1}</td></tr>", new object[] { visualLoc.Status, visualLoc.LocUsage, base.GetGlobalMsgResource("F5400_010"), base.GetGlobalMsgResource("F5400_011") });
            strDiv.AppendFormat(" <tr> <td class=\"areaname\">{2}：</td> <td class=\"areamessage\">{0}</td><td class=\"areaname\">{3}：</td><td class=\"areamessage\">{1}</td></tr> ", new object[] { visualLoc.CubicCapacity, visualLoc.LocHandling, base.GetGlobalMsgResource("F5400_012"), base.GetGlobalMsgResource("F5400_013") });
            strDiv.AppendFormat(" <tr>{0}</tr> ", this.LocationEmploy(visualLoc));
            strDiv.Append(" </table></td></tr>");
            strDiv.Append("<tr><td height=\"7\" background=\"../Images/slotbg_02.gif\"></td></tr>");
            strDiv.Append("<tr><td background=\"../Images/slotbg_03.gif\" > <div style=\"overflow-y:auto; height:150px; width:98%;\"><table width=\"94%\" border=\"0\" align=\"right\" cellpadding=\"0\" cellspacing=\"0\"> ");
            strDiv.AppendFormat("{0}", this.SkuHtmlConvert(visualLoc.InvLotLocLpnInfos));
            strDiv.Append("</table></div></td></tr><tr><td height=\"18\" background=\"../Images/slotbg_04.gif\">&nbsp;</td></tr></table>");
            this.AssignFunctionResponse(strDiv.ToString());
        }

        private string LocationCount(string Loc)
        {
            string strIndex = string.Empty;
            Loc = Loc.Replace("=", "");
            Loc = Loc.Replace("!", "");
            Loc = Loc.Replace("@", "");
            Loc = Loc.Replace("#", "");
            Loc = Loc.Replace("$", "");
            Loc = Loc.Replace("%", "");
            Loc = Loc.Replace("^", "");
            Loc = Loc.Replace("&", "");
            Loc = Loc.Replace("*", "");
            Loc = Loc.Replace("(", "");
            Loc = Loc.Replace(")", "");
            Loc = Loc.Replace("~", "");
            Loc = Loc.Replace("?", "");
            Loc = Loc.Replace(",", "");
            Loc = Loc.Replace(".", "");
            Loc = Loc.Replace("<", "");
            Loc = Loc.Replace(">", "");
            Loc = Loc.Replace("+", "");
            Loc = Loc.Replace("`", "");
            Loc = Loc.Replace("_", "");
            Loc = Loc.Replace("/", "");
            Loc = Loc.Replace(",", "");
            Loc = Loc.Replace("-", "");
            for (int i = 0; Loc.Length > i; i++)
            {
                char CS00001 = Loc[i];
                strIndex = strIndex + this.ConvertToIntByValue(CS00001.ToString());
            }
            return strIndex;
        }

        private string LocationEmploy(VisualLocationInfo info)
        {
            StringBuilder strCubicCapacity = new StringBuilder();
            if (info.CubicCapacity == 0.0)
            {
                strCubicCapacity.AppendFormat(" <td class=\"areaname\"></td><td class=\"areamessage\"></td> <td class=\"areaname\">{0}：</td><td class=\"areamessage\">0%</td>", base.GetGlobalMsgResource("F5400_014"));
            }
            else
            {
                long z = Convert.ToInt64((double) (((info.CubicCount * 100.0) / (info.CubicCapacity * 100.0)) * 100.0));
                long k = ((100 - z) < 0) ? 0 : (100 - z);
                strCubicCapacity.AppendFormat(" <td class=\"areaname\"></td><td class=\"areamessage\"></td> <td class=\"areaname\">{2}：</td><td class=\"areamessage\">{1}%</td>", k, z, base.GetGlobalMsgResource("F5400_014"));
            }
            return strCubicCapacity.ToString();
        }

        private string LocationHtmlCreate(List<VisualLocationInfo> VisualLocation)
        {
            return (this.LocationTridimensionalCreate(VisualLocation.FindAll(x => this.LocType(x.Loc) == 3)) + this.LocationPlanarCreate(VisualLocation.FindAll(x => this.LocType(x.Loc) == 2)) + this.LocationPlaneCreate(VisualLocation.FindAll(x => this.LocType(x.Loc) == 0)));
        }

        private string LocationPlanarCreate(List<VisualLocationInfo> VisualLocation)
        {
            StringBuilder strLocHtml = new StringBuilder();
            if (VisualLocation.Count > 0)
            {
                string StrLine = string.Empty;
                foreach (VisualLocationInfo info in VisualLocation)
                {
                    string StrLineInfo = this.LocSplit(info.Loc, "Line");
                    if (StrLineInfo != StrLine)
                    {
                        strLocHtml.AppendFormat(" <table width=\"@ZoneWidthpx\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin-bottom:4px;\"><tr><td width=\"20\" rowspan=\"2\"  align=\"center\">{0}</td></tr>", StrLineInfo);
                        strLocHtml.AppendFormat("{0}", this.LocationPlanarRowCreate(VisualLocation.FindAll(x => this.LocSplit(x.Loc, "Line") == StrLineInfo)));
                        strLocHtml.Replace("@ZoneWidth", ((this.RowsCount + 2) * 20).ToString());
                        strLocHtml.Append("</table>");
                        StrLine = StrLineInfo;
                    }
                }
            }
            return strLocHtml.ToString();
        }

        private string LocationPlanarRowCreate(List<VisualLocationInfo> VisualLocation)
        {
            this.RowsCount = 0;
            StringBuilder strTierHtml = new StringBuilder();
            strTierHtml.Append("<tr>");
            strTierHtml.Append(" <td width=\"20\" align=\"center\">&nbsp;</td>");
            foreach (VisualLocationInfo info in VisualLocation)
            {
                strTierHtml.AppendFormat(" <td class=\"{1}\" title=\"{0}\"  onclick=\"LocAndSkuShow('{0}');\">&nbsp;</td>", info.Loc, this.LocVolume(info));
                this.RowsCount++;
            }
            strTierHtml.Append("</tr>");
            if (this.DivCount < this.RowsCount)
            {
                this.DivCount = this.RowsCount;
            }
            return strTierHtml.ToString();
        }

        private string LocationPlaneCreate(List<VisualLocationInfo> VisualLocation)
        {
            StringBuilder strLocHtml = new StringBuilder();
            if (VisualLocation.Count > 0)
            {
                strLocHtml.Append("<table width=\"@ZoneWidthpx\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin-bottom:4px;\"><tr><td width=\"20\" rowspan=\"2\"  align=\"center\"></td></tr><tr><td width=\"20\" align=\"center\"></td>");
                foreach (VisualLocationInfo info in VisualLocation)
                {
                    this.RowsCount++;
                    strLocHtml.AppendFormat("<td  class=\"{1}\"  onclick=\"LocAndSkuShow('{0}');\" title=\"{0}\" ></td>", info.Loc, this.LocVolume(info));
                }
                if (this.DivCount < this.RowsCount)
                {
                    this.DivCount = this.RowsCount;
                }
                strLocHtml.Replace("@ZoneWidth", ((this.RowsCount + 2) * 20).ToString());
                strLocHtml.Append("</tr></table>");
            }
            return strLocHtml.ToString();
        }

        private string LocationTridimensionalCreate(List<VisualLocationInfo> VisualLocation)
        {
            StringBuilder strLocHtml = new StringBuilder();
            if (VisualLocation.Count > 0)
            {
                string StrLine = string.Empty;
                foreach (VisualLocationInfo info in VisualLocation)
                {
                    string StrLineInfo = this.LocSplit(info.Loc, "Line");
                    if (StrLineInfo != StrLine)
                    {
                        strLocHtml.AppendFormat(" <table width=\"@ZoneWidthpx\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin-bottom:4px;\"><tr><td width=\"20\" rowspan=\"@RowsPan\" align=\"center\">{0}</td></tr>", StrLineInfo);
                        strLocHtml.AppendFormat("{0}", this.TierHtmlCreate(VisualLocation.FindAll(x => this.LocSplit(x.Loc, "Line") == StrLineInfo)));
                        int CS00003 = this.TierCount + 1;
                        strLocHtml.Replace("@RowsPan", CS00003.ToString());
                        strLocHtml.Replace("@ZoneWidth", ((this.RowsCount + 2) * 20).ToString());
                        strLocHtml.Append("</table>");
                        StrLine = StrLineInfo;
                    }
                }
            }
            return strLocHtml.ToString();
        }

        private void LocDataRemark(string strZone, string strColor)
        {
            this.strZoneColor.AppendFormat("<div  style=\"float:left\" class=\"areaname\">{0}:&nbsp;</div><div style=\"width:25px; height:10px; margin-right:20px;float:left\" class=\"{1}\">&nbsp;</div>", strZone, strColor);
        }

        private string[] LocSplit(string strLoc)
        {
            if (strLoc.Split(new char[] { '=' }).Length > 1)
            {
                return strLoc.Split(new char[] { '=' });
            }
            if (strLoc.Split(new char[] { '!' }).Length > 1)
            {
                return strLoc.Split(new char[] { '!' });
            }
            if (strLoc.Split(new char[] { '@' }).Length > 1)
            {
                return strLoc.Split(new char[] { '@' });
            }
            if (strLoc.Split(new char[] { '#' }).Length > 1)
            {
                return strLoc.Split(new char[] { '#' });
            }
            if (strLoc.Split(new char[] { '$' }).Length > 1)
            {
                return strLoc.Split(new char[] { '$' });
            }
            if (strLoc.Split(new char[] { '%' }).Length > 1)
            {
                return strLoc.Split(new char[] { '%' });
            }
            if (strLoc.Split(new char[] { '^' }).Length > 1)
            {
                return strLoc.Split(new char[] { '^' });
            }
            if (strLoc.Split(new char[] { '&' }).Length > 1)
            {
                return strLoc.Split(new char[] { '&' });
            }
            if (strLoc.Split(new char[] { '*' }).Length > 1)
            {
                return strLoc.Split(new char[] { '*' });
            }
            if (strLoc.Split(new char[] { '(' }).Length > 1)
            {
                return strLoc.Split(new char[] { '(' });
            }
            if (strLoc.Split(new char[] { ')' }).Length > 1)
            {
                return strLoc.Split(new char[] { ')' });
            }
            if (strLoc.Split(new char[] { '~' }).Length > 1)
            {
                return strLoc.Split(new char[] { '~' });
            }
            if (strLoc.Split(new char[] { '?' }).Length > 1)
            {
                return strLoc.Split(new char[] { '?' });
            }
            if (strLoc.Split(new char[] { ',' }).Length > 1)
            {
                return strLoc.Split(new char[] { ',' });
            }
            if (strLoc.Split(new char[] { '.' }).Length > 1)
            {
                return strLoc.Split(new char[] { '.' });
            }
            if (strLoc.Split(new char[] { '<' }).Length > 1)
            {
                return strLoc.Split(new char[] { '<' });
            }
            if (strLoc.Split(new char[] { '>' }).Length > 1)
            {
                return strLoc.Split(new char[] { '>' });
            }
            if (strLoc.Split(new char[] { '+' }).Length > 1)
            {
                return strLoc.Split(new char[] { '+' });
            }
            if (strLoc.Split(new char[] { '`' }).Length > 1)
            {
                return strLoc.Split(new char[] { '`' });
            }
            if (strLoc.Split(new char[] { '_' }).Length > 1)
            {
                return strLoc.Split(new char[] { '_' });
            }
            if (strLoc.Split(new char[] { '/' }).Length > 1)
            {
                return strLoc.Split(new char[] { '/' });
            }
            if (strLoc.Split(new char[] { ',' }).Length > 1)
            {
                return strLoc.Split(new char[] { ',' });
            }
            if (strLoc.Split(new char[] { '-' }).Length > 1)
            {
                return strLoc.Split(new char[] { '-' });
            }
            return null;
        }

        private string LocSplit(string strLoc, string type)
        {
            string[] strLocSplit = null;
            string StrValue = string.Empty;
            if (strLoc.Split(new char[] { '=' }).Length > 1)
            {
                strLocSplit = strLoc.Split(new char[] { '=' });
            }
            if (strLoc.Split(new char[] { '!' }).Length > 1)
            {
                strLocSplit = strLoc.Split(new char[] { '!' });
            }
            if (strLoc.Split(new char[] { '@' }).Length > 1)
            {
                strLocSplit = strLoc.Split(new char[] { '@' });
            }
            if (strLoc.Split(new char[] { '#' }).Length > 1)
            {
                strLocSplit = strLoc.Split(new char[] { '#' });
            }
            if (strLoc.Split(new char[] { '$' }).Length > 1)
            {
                strLocSplit = strLoc.Split(new char[] { '$' });
            }
            if (strLoc.Split(new char[] { '%' }).Length > 1)
            {
                strLocSplit = strLoc.Split(new char[] { '%' });
            }
            if (strLoc.Split(new char[] { '^' }).Length > 1)
            {
                strLocSplit = strLoc.Split(new char[] { '^' });
            }
            if (strLoc.Split(new char[] { '&' }).Length > 1)
            {
                strLocSplit = strLoc.Split(new char[] { '&' });
            }
            if (strLoc.Split(new char[] { '*' }).Length > 1)
            {
                strLocSplit = strLoc.Split(new char[] { '*' });
            }
            if (strLoc.Split(new char[] { '(' }).Length > 1)
            {
                strLocSplit = strLoc.Split(new char[] { '(' });
            }
            if (strLoc.Split(new char[] { ')' }).Length > 1)
            {
                strLocSplit = strLoc.Split(new char[] { ')' });
            }
            if (strLoc.Split(new char[] { '~' }).Length > 1)
            {
                strLocSplit = strLoc.Split(new char[] { '~' });
            }
            if (strLoc.Split(new char[] { '?' }).Length > 1)
            {
                strLocSplit = strLoc.Split(new char[] { '?' });
            }
            if (strLoc.Split(new char[] { ',' }).Length > 1)
            {
                strLocSplit = strLoc.Split(new char[] { ',' });
            }
            if (strLoc.Split(new char[] { '.' }).Length > 1)
            {
                strLocSplit = strLoc.Split(new char[] { '.' });
            }
            if (strLoc.Split(new char[] { '<' }).Length > 1)
            {
                strLocSplit = strLoc.Split(new char[] { '<' });
            }
            if (strLoc.Split(new char[] { '>' }).Length > 1)
            {
                strLocSplit = strLoc.Split(new char[] { '>' });
            }
            if (strLoc.Split(new char[] { '+' }).Length > 1)
            {
                strLocSplit = strLoc.Split(new char[] { '+' });
            }
            if (strLoc.Split(new char[] { '`' }).Length > 1)
            {
                strLocSplit = strLoc.Split(new char[] { '`' });
            }
            if (strLoc.Split(new char[] { '_' }).Length > 1)
            {
                strLocSplit = strLoc.Split(new char[] { '_' });
            }
            if (strLoc.Split(new char[] { '/' }).Length > 1)
            {
                strLocSplit = strLoc.Split(new char[] { '/' });
            }
            if (strLoc.Split(new char[] { ',' }).Length > 1)
            {
                strLocSplit = strLoc.Split(new char[] { ',' });
            }
            if (strLoc.Split(new char[] { '-' }).Length > 1)
            {
                strLocSplit = strLoc.Split(new char[] { '-' });
            }
            if (strLocSplit.Length > 0)
            {
                string CS40003 = type;
                if (CS40003 == null)
                {
                    return StrValue;
                }
                if (!(CS40003 == "Line"))
                {
                    if (CS40003 != "Row")
                    {
                        if ((CS40003 == "Tier") && (strLocSplit.Length >= 3))
                        {
                            StrValue = strLocSplit[2];
                        }
                        return StrValue;
                    }
                }
                else
                {
                    if (strLocSplit.Length >= 2)
                    {
                        StrValue = strLocSplit[0];
                    }
                    return StrValue;
                }
                if (strLocSplit.Length >= 2)
                {
                    StrValue = strLocSplit[1];
                }
            }
            return StrValue;
        }

        private int LocType(string strLoc)
        {
            if (strLoc.Split(new char[] { '=' }).Length > 1)
            {
                return strLoc.Split(new char[] { '=' }).Length;
            }
            if (strLoc.Split(new char[] { '!' }).Length > 1)
            {
                return strLoc.Split(new char[] { '!' }).Length;
            }
            if (strLoc.Split(new char[] { '@' }).Length > 1)
            {
                return strLoc.Split(new char[] { '@' }).Length;
            }
            if (strLoc.Split(new char[] { '#' }).Length > 1)
            {
                return strLoc.Split(new char[] { '#' }).Length;
            }
            if (strLoc.Split(new char[] { '$' }).Length > 1)
            {
                return strLoc.Split(new char[] { '$' }).Length;
            }
            if (strLoc.Split(new char[] { '%' }).Length > 1)
            {
                return strLoc.Split(new char[] { '%' }).Length;
            }
            if (strLoc.Split(new char[] { '^' }).Length > 1)
            {
                return strLoc.Split(new char[] { '^' }).Length;
            }
            if (strLoc.Split(new char[] { '&' }).Length > 1)
            {
                return strLoc.Split(new char[] { '&' }).Length;
            }
            if (strLoc.Split(new char[] { '*' }).Length > 1)
            {
                return strLoc.Split(new char[] { '*' }).Length;
            }
            if (strLoc.Split(new char[] { '(' }).Length > 1)
            {
                return strLoc.Split(new char[] { '(' }).Length;
            }
            if (strLoc.Split(new char[] { ')' }).Length > 1)
            {
                return strLoc.Split(new char[] { ')' }).Length;
            }
            if (strLoc.Split(new char[] { '~' }).Length > 1)
            {
                return strLoc.Split(new char[] { '~' }).Length;
            }
            if (strLoc.Split(new char[] { '?' }).Length > 1)
            {
                return strLoc.Split(new char[] { '?' }).Length;
            }
            if (strLoc.Split(new char[] { ',' }).Length > 1)
            {
                return strLoc.Split(new char[] { ',' }).Length;
            }
            if (strLoc.Split(new char[] { '.' }).Length > 1)
            {
                return strLoc.Split(new char[] { '.' }).Length;
            }
            if (strLoc.Split(new char[] { '<' }).Length > 1)
            {
                return strLoc.Split(new char[] { '<' }).Length;
            }
            if (strLoc.Split(new char[] { '>' }).Length > 1)
            {
                return strLoc.Split(new char[] { '>' }).Length;
            }
            if (strLoc.Split(new char[] { '+' }).Length > 1)
            {
                return strLoc.Split(new char[] { '+' }).Length;
            }
            if (strLoc.Split(new char[] { '`' }).Length > 1)
            {
                return strLoc.Split(new char[] { '`' }).Length;
            }
            if (strLoc.Split(new char[] { '_' }).Length > 1)
            {
                return strLoc.Split(new char[] { '_' }).Length;
            }
            if (strLoc.Split(new char[] { '/' }).Length > 1)
            {
                return strLoc.Split(new char[] { '/' }).Length;
            }
            if (strLoc.Split(new char[] { ',' }).Length > 1)
            {
                return strLoc.Split(new char[] { ',' }).Length;
            }
            if (strLoc.Split(new char[] { '-' }).Length > 1)
            {
                return strLoc.Split(new char[] { '-' }).Length;
            }
            return 0;
        }

        public string LocVolume(VisualLocationInfo info)
        {
            string StrClassName = "nocolor";
            float z = (Convert.ToSingle((double) (info.CubicCount * 100.0)) / Convert.ToSingle((double) (info.CubicCapacity * 100.0))) * 100f;
            if (((info.CubicCapacity == 0.0) && (info.CubicCount > 0.0)) || (z.ToString() == "Infinity"))
            {
                StrClassName = "fullcolor";
            }
            else if (z == 0f)
            {
                StrClassName = "nocolor";
            }
            else if ((z > 0f) && (z <= 30f))
            {
                StrClassName = "somecolor3";
            }
            else if ((z > 0f) && (z <= 30f))
            {
                StrClassName = "somecolor3";
            }
            else if ((z > 30f) && (z <= 60f))
            {
                StrClassName = "somecolor2";
            }
            else if ((z > 60f) && (z < 100f))
            {
                StrClassName = "somecolor1";
            }
            else if (z >= 100f)
            {
                StrClassName = "fullcolor";
            }
            if (info.Status.ToUpper() == "HOLD")
            {
                StrClassName = "holdcolor";
            }
            return StrClassName;
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            base.Response.Buffer = true;
            base.Response.ExpiresAbsolute = DateTime.Now.AddSeconds(-1.0);
            base.Response.Expires = 0;
            base.Response.CacheControl = "no-cache";
            base.Response.AddHeader("Pragma", "No-Cache");
            this.ShowEffect = base.Request.QueryString["ShowEffect"];
            string CS40001 = base.Request.QueryString["TYPE"];
            if (CS40001 != null)
            {
                if (!(CS40001 == "Location"))
                {
                    if (CS40001 == "SkuDetail")
                    {
                        this.GetSkuDataById(base.Request.QueryString["LocationID"]);
                    }
                }
                else
                {
                    this.GetPublicLocData();
                    this.GetLocDataByWh();
                }
            }
        }

        private void QueryLocData()
        {
            string strLoc = base.Request.QueryString["QueryLocID"];
            string strSkuID = base.Request.QueryString["QuerySkuID"];
            string strStatus = base.Request.QueryString["QueryStatus"];
            string strZoneID = base.Request.QueryString["QueryZoneID"];
            List<VisualLocationInfo> VisualLocation = this.Session["VisualLocSession"] as List<VisualLocationInfo>;
            if (((!string.IsNullOrEmpty(strLoc) || !string.IsNullOrEmpty(strSkuID)) || !string.IsNullOrEmpty(strStatus)) || !string.IsNullOrEmpty(strZoneID))
            {
                if (!string.IsNullOrEmpty(strZoneID))
                {
                    VisualLocation = VisualLocation.FindAll(x => x.ZoneID.ToUpper() == strZoneID.ToUpper());
                }
                if (!string.IsNullOrEmpty(strLoc))
                {
                    VisualLocation = VisualLocation.FindAll(x => x.Loc.ToUpper() == strLoc.ToUpper());
                }
                if (!string.IsNullOrEmpty(strSkuID))
                {
                    VisualLocation = VisualLocation.FindAll(x => x.InvLotLocLpnInfos.Exists(i => i.SkuID.ToUpper() == strSkuID.ToUpper()));
                }
                if (!string.IsNullOrEmpty(strStatus))
                {
                    VisualLocation = VisualLocation.FindAll(x => x.Status.ToUpper() == strStatus.ToUpper());
                }
                if (VisualLocation.Count > 0)
                {
                    if (this.ShowEffect == "Solid")
                    {
                        this.SolidZoneHtmlCreate(VisualLocation);
                    }
                    else
                    {
                        this.ZoneHtmlCreate(VisualLocation);
                    }
                }
                else
                {
                    this.AssignFunctionResponse(" @_@<center  style=\"color:Red\" >" + base.GetGlobalMsgResource("C014") + "</center>");
                }
            }
            else if (this.ShowEffect == "Solid")
            {
                this.SolidZoneHtmlCreate(VisualLocation);
            }
            else
            {
                this.ZoneHtmlCreate(VisualLocation);
            }
        }

        private string RowHtmlCreate(List<VisualLocationInfo> VisualLocation, List<string> RowMax)
        {
            StringBuilder strRowHtml = new StringBuilder();
            for (int i = 0; RowMax.Count > i; i++)
            {
                bool IsExist = false;
                string StrLocID = string.Empty;
                VisualLocationInfo VL = null;
                foreach (VisualLocationInfo info in VisualLocation)
                {
                    StrLocID = info.Loc;
                    string StrRowIndex = this.LocSplit(info.Loc, "Row");
                    if (RowMax[i] == StrRowIndex)
                    {
                        VL = info;
                        IsExist = true;
                        break;
                    }
                }
                if (IsExist)
                {
                    strRowHtml.AppendFormat(" <td class=\"{1}\" title=\"{0}\"  onclick=\"LocAndSkuShow('{0}');\" >&nbsp;</td>", StrLocID, this.LocVolume(VL));
                }
                else
                {
                    strRowHtml.Append(" <td class=\"defaultcolor\">&nbsp;</td>");
                }
            }
            return strRowHtml.ToString();
        }

        private List<string> RowsMax(List<VisualLocationInfo> VisualLocation)
        {
            List<string> RowMax = new List<string>();
            foreach (VisualLocationInfo info in VisualLocation)
            {
                bool IsExist = false;
                string Row = this.LocSplit(info.Loc, "Row");
                for (int i = 0; RowMax.Count > i; i++)
                {
                    if (Row == RowMax[i])
                    {
                        IsExist = true;
                        break;
                    }
                }
                if (!IsExist)
                {
                    RowMax.Add(Row);
                }
            }
            this.RowsCount = RowMax.Count;
            if (this.DivCount < this.RowsCount)
            {
                this.DivCount = this.RowsCount;
            }
            return RowMax;
        }

        private string SelectColor(string strZone)
        {
            string strColor = string.Empty;
            if (this.strColorList.Count > 0)
            {
                int i = 0;
                while (this.strColorList.Count > i)
                {
                    strColor = this.strColorList[i];
                    this.strColorList.RemoveAt(i);
                    this.LocDataRemark(strZone, strColor);
                    return strColor;
                }
            }
            return strColor;
        }

        private string SilidLocationHtmlCreate(List<VisualLocationInfo> VisualLocation)
        {
            return (this.SilidLocationTridimensionalCreate(VisualLocation.FindAll(x => this.LocType(x.Loc) == 3)) + this.SilidLocationPlanarCreate(VisualLocation.FindAll(x => this.LocType(x.Loc) == 2)) + this.SilidLocationPlaneCreate(VisualLocation.FindAll(x => this.LocType(x.Loc) == 0)));
        }

        private string SilidLocationPlanarCreate(List<VisualLocationInfo> VisualLocation)
        {
            StringBuilder strLocHtml = new StringBuilder();
            if (VisualLocation.Count > 0)
            {
                string StrLine = string.Empty;
                foreach (VisualLocationInfo info in VisualLocation)
                {
                    string StrLineInfo = this.LocSplit(info.Loc, "Line");
                    if (StrLineInfo != StrLine)
                    {
                        strLocHtml.AppendFormat(" <table width=\"@ZoneWidthpx\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin-bottom:4px;\"><tr><td width=\"20\" rowspan=\"2\" align=\"center\">{0}</td><td width=\"20\"></td>@TdTop</tr>", StrLineInfo);
                        strLocHtml.AppendFormat("{0}", this.SilidLocationPlanarRowCreate(VisualLocation.FindAll(x => this.LocSplit(x.Loc, "Line") == StrLineInfo)));
                        strLocHtml.Replace("@TdTop", this.TdTop(this.RowsCount));
                        strLocHtml.Replace("@ZoneWidth", ((this.RowsCount * 0x43) + 0x33).ToString());
                        strLocHtml.Append("</table>");
                        StrLine = StrLineInfo;
                    }
                }
            }
            return strLocHtml.ToString();
        }

        private string SilidLocationPlanarRowCreate(List<VisualLocationInfo> VisualLocation)
        {
            this.RowsCount = 0;
            StringBuilder strTierHtml = new StringBuilder();
            strTierHtml.Append("<tr>");
            strTierHtml.Append(" <td width=\"20\" align=\"center\"></td>");
            foreach (VisualLocationInfo info in VisualLocation)
            {
                this.RowsCount++;
                if (this.RowsCount == 1)
                {
                    strTierHtml.Append("<td class=\"stereo_left\"></td>");
                }
                else
                {
                    strTierHtml.Append(" <td class=\"stereo_linebg\"></td>");
                }
                strTierHtml.AppendFormat(" <td class=\"{1}\" title=\"{0}\"  onclick=\"LocAndSkuShow('{0}');\"></td>", info.Loc, this.SilidLocVolume(info));
            }
            strTierHtml.Append("   <td class=\"stereo_bottomright\"></td>");
            strTierHtml.Append("</tr>");
            this.TierCount = this.RowsCount;
            if (this.DivCount < this.RowsCount)
            {
                this.DivCount = this.RowsCount;
            }
            return strTierHtml.ToString();
        }

        private string SilidLocationPlaneCreate(List<VisualLocationInfo> VisualLocation)
        {
            this.RowsCount = 0;
            StringBuilder strLocHtml = new StringBuilder();
            if (VisualLocation.Count > 0)
            {
                strLocHtml.Append("<table width=\"@ZoneWidthpx\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin-bottom:4px;\"><tr><td width=\"20\" rowspan=\"2\"  align=\"center\"></td> <td width=\"20\" align=\"center\"></td>@TdTop</tr><tr><td width=\"20\" align=\"center\"></td>");
                foreach (VisualLocationInfo info in VisualLocation)
                {
                    this.RowsCount++;
                    if (this.RowsCount == 1)
                    {
                        strLocHtml.Append("<td class=\"stereo_left\"></td>");
                    }
                    else
                    {
                        strLocHtml.Append(" <td class=\"stereo_linebg\"></td>");
                    }
                    strLocHtml.AppendFormat(" <td class=\"{1}\" title=\"{0}\"  onclick=\"LocAndSkuShow('{0}');\"></td>", info.Loc, this.SilidLocVolume(info));
                }
                strLocHtml.Append("   <td class=\"stereo_bottomright\"></td>");
                if (this.DivCount < this.RowsCount)
                {
                    this.DivCount = this.RowsCount;
                }
                strLocHtml.Replace("@TdTop", this.TdTop(this.RowsCount));
                strLocHtml.Replace("@ZoneWidth", ((this.RowsCount * 0x43) + 0x33).ToString());
                strLocHtml.Append("</tr></table>");
            }
            return strLocHtml.ToString();
        }

        private string SilidLocationTridimensionalCreate(List<VisualLocationInfo> VisualLocation)
        {
            StringBuilder strLocHtml = new StringBuilder();
            if (VisualLocation.Count > 0)
            {
                string StrLine = string.Empty;
                foreach (VisualLocationInfo info in VisualLocation)
                {
                    string StrLineInfo = this.LocSplit(info.Loc, "Line");
                    if (StrLineInfo != StrLine)
                    {
                        strLocHtml.AppendFormat(" <table width=\"@ZoneWidthpx\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin-bottom:4px;\"><tr><td width=\"20\" rowspan=\"@RowsPan\" align=\"center\">{0}</td><td width=\"20\"></td>@TdTop</tr>", StrLineInfo);
                        strLocHtml.AppendFormat("{0}", this.SilidTierHtmlCreate(VisualLocation.FindAll(x => this.LocSplit(x.Loc, "Line") == StrLineInfo)));
                        strLocHtml.Replace("@TdTop", this.TdTop(this.RowsCount));
                        int CS00003 = this.TierCount + 1;
                        strLocHtml.Replace("@RowsPan", CS00003.ToString());
                        strLocHtml.Replace("@ZoneWidth", ((this.RowsCount * 0x43) + 0x33).ToString());
                        strLocHtml.Append("</table>");
                        StrLine = StrLineInfo;
                    }
                }
            }
            return strLocHtml.ToString();
        }

        public string SilidLocVolume(VisualLocationInfo info)
        {
            string StrClassName = "stereo_0";
            float z = (Convert.ToSingle((double) (info.CubicCount * 100.0)) / Convert.ToSingle((double) (info.CubicCapacity * 100.0))) * 100f;
            if (((info.CubicCapacity == 0.0) && (info.CubicCount > 0.0)) || (z.ToString() == "Infinity"))
            {
                StrClassName = "stereo_5";
            }
            else if (z == 0f)
            {
                StrClassName = "stereo_0";
            }
            else if ((z > 0f) && (z <= 20f))
            {
                StrClassName = "stereo_1";
            }
            else if ((z > 20f) && (z <= 40f))
            {
                StrClassName = "stereo_2";
            }
            else if ((z > 40f) && (z <= 60f))
            {
                StrClassName = "stereo_3";
            }
            else if ((z > 60f) && (z <= 80f))
            {
                StrClassName = "stereo_4";
            }
            else if (z > 80f)
            {
                StrClassName = "stereo_5";
            }
            if (info.Status.ToUpper() == "HOLD")
            {
                StrClassName = "stereo_hold";
            }
            return StrClassName;
        }

        private string SilidRowHtmlCreate(List<VisualLocationInfo> VisualLocation, List<string> RowMax)
        {
            StringBuilder strRowHtml = new StringBuilder();
            for (int i = 0; RowMax.Count > i; i++)
            {
                bool IsExist = false;
                string StrLocID = string.Empty;
                VisualLocationInfo VL = null;
                foreach (VisualLocationInfo info in VisualLocation)
                {
                    StrLocID = info.Loc;
                    string StrRowIndex = this.LocSplit(info.Loc, "Row");
                    if (RowMax[i] == StrRowIndex)
                    {
                        VL = info;
                        IsExist = true;
                        break;
                    }
                }
                if (IsExist)
                {
                    if (i == 0)
                    {
                        strRowHtml.Append("<td class=\"stereo_left\"></td>");
                    }
                    else if (i != RowMax.Count)
                    {
                        strRowHtml.Append(" <td class=\"stereo_linebg\"></td>");
                    }
                    strRowHtml.AppendFormat(" <td class=\"{1}\" title=\"{0}\"  onclick=\"LocAndSkuShow('{0}');\" ></td>", StrLocID, this.SilidLocVolume(VL));
                }
                else
                {
                    if (i == 0)
                    {
                        strRowHtml.Append("<td class=\"stereo_left\"></td>");
                    }
                    else if (i != RowMax.Count)
                    {
                        strRowHtml.Append(" <td class=\"stereo_linebg\"></td> ");
                    }
                    strRowHtml.Append(" <td class=\"stereo_no\"></td>");
                }
            }
            strRowHtml.Append("<td class=\"@ClssTier\"></td>");
            return strRowHtml.ToString();
        }

        private string SilidTierHtmlCreate(List<VisualLocationInfo> VisualLocation)
        {
            List<string> StrTierList = new List<string>();
            StringBuilder strTierHtml = new StringBuilder();
            foreach (VisualLocationInfo info in VisualLocation)
            {
                string StrTierInfo = this.LocSplit(info.Loc, "Tier");
                bool IsExist = false;
                for (int i = 0; StrTierList.Count > i; i++)
                {
                    if (StrTierInfo == StrTierList[i])
                    {
                        IsExist = true;
                        break;
                    }
                }
                if (!IsExist)
                {
                    StringBuilder strTierValue = new StringBuilder();
                    strTierValue.Append("<tr>");
                    strTierValue.AppendFormat(" <td width=\"20\" align=\"center\">{0}</td>{1}", StrTierInfo, this.SilidRowHtmlCreate(VisualLocation.FindAll(x => this.LocSplit(x.Loc, "Tier") == StrTierInfo), this.RowsMax(VisualLocation)));
                    strTierValue.Append("</tr>");
                    StrTierList.Add(StrTierInfo);
                    this.TierCount++;
                    if (StrTierList.Count == 1)
                    {
                        strTierValue.Replace("@ClssTier", "stereo_bottomright");
                    }
                    else
                    {
                        strTierValue.Replace("@ClssTier", " stereo_right");
                    }
                    strTierHtml.Insert(0, strTierValue.ToString());
                }
            }
            return strTierHtml.ToString();
        }

        private string SkuHtmlConvert(List<InvLotLocLpnInfo> InvLotLocLpnList)
        {
            string strHistoryData = base.Request.QueryString["HistoryData"];
            StringBuilder strSku = new StringBuilder();
            strSku.Append("<tr><td>");
            if (InvLotLocLpnList.Count > 0)
            {
                foreach (InvLotLocLpnInfo info in InvLotLocLpnList)
                {
                    if (strHistoryData.ToUpper() != "TRUE")
                    {
                        if (info.Qty != 0M)
                        {
                            strSku.Append("<table width=\"32%\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\"class=\"slotbox\" style=\"float:left; margin-right:5px;margin-top:5px;\">");
                            strSku.Append("<tr><td colspan=\"2\"><img src=\"../Images/box.gif\" width=\"40\" height=\"32\"></td></tr>");
                            strSku.AppendFormat("  <tr><td width=\"20%\" nowrap>{1}：</td><td class=\"areamessage\">{0}</td></tr>", info.Qty.ToString("0.00"), base.GetGlobalMsgResource("F5400_001"));
                            strSku.AppendFormat("  <tr><td width=\"20%\">{1}：</td><td class=\"areamessage\">{0}</td></tr>", info.SkuID, base.GetGlobalMsgResource("F5400_002"));
                            strSku.AppendFormat("  <tr><td width=\"20%\">{1}：</td><td class=\"areamessage\">{0}</td></tr>", info.Lot, base.GetGlobalMsgResource("F5400_003"));
                            strSku.AppendFormat("  <tr><td width=\"20%\">Lpn：</td><td class=\"areamessage\">{0}</td></tr>", info.LpnID);
                            strSku.AppendFormat("  <tr><td width=\"20%\">{1}：</td><td class=\"areamessage\">{0}</td></tr></table>", info.Status, base.GetGlobalMsgResource("F5400_004"));
                        }
                    }
                    else
                    {
                        strSku.Append("<table width=\"32%\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\"class=\"slotbox\" style=\"float:left; margin-right:5px;margin-top:5px;\">");
                        strSku.Append("<tr><td colspan=\"2\"><img src=\"../Images/box.gif\" width=\"40\" height=\"32\"></td></tr>");
                        strSku.AppendFormat("  <tr><td width=\"20%\" nowrap>{1}：</td><td class=\"areamessage\">{0}</td></tr>", info.Qty.ToString("0.00"), base.GetGlobalMsgResource("F5400_001"));
                        strSku.AppendFormat("  <tr><td width=\"20%\">{1}：</td><td class=\"areamessage\">{0}</td></tr>", info.SkuID, base.GetGlobalMsgResource("F5400_002"));
                        strSku.AppendFormat("  <tr><td width=\"20%\">{1}：</td><td class=\"areamessage\">{0}</td></tr>", info.Lot, base.GetGlobalMsgResource("F5400_003"));
                        strSku.AppendFormat("  <tr><td width=\"20%\">Lpn：</td><td class=\"areamessage\">{0}</td></tr>", info.LpnID);
                        strSku.AppendFormat("  <tr><td width=\"20%\">{1}：</td><td class=\"areamessage\">{0}</td></tr></table>", info.Status, base.GetGlobalMsgResource("F5400_004"));
                    }
                }
            }
            else
            {
                strSku.Append("<table width=\"32%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" ><tr><td align=\"center\"  style=\"color:Red\">该货位没有货品记录&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td></tr></table>");
            }
            strSku.Append("</td></tr>");
            return strSku.ToString();
        }

        private void SolidZoneHtmlCreate(List<VisualLocationInfo> VisualLocation)
        {
            string StrZoneName = "";
            List<string> ZoneList = new List<string>();
            foreach (VisualLocationInfo info in VisualLocation)
            {
                if (info.ZoneID != StrZoneName)
                {
                    StrZoneName = info.ZoneID;
                    StringBuilder ZoneHtml = new StringBuilder();
                    ZoneHtml.AppendFormat("  <div style=\"width:@ZoneWidthpx  ;margin-bottom:4px \" class=\"{0}\"> ", this.SelectColor(info.ZoneID));
                    ZoneHtml.AppendFormat("{0}", this.SilidLocationHtmlCreate(VisualLocation.FindAll(x => x.ZoneID == StrZoneName)));
                    ZoneHtml.Append("</div>");
                    ZoneHtml.Replace("@ZoneWidth", ((this.DivCount * 0x43) + 0x37).ToString());
                    ZoneList.Add(ZoneHtml.ToString());
                    if (this.SequenceNumber < this.DivCount)
                    {
                        this.SequenceNumber = this.DivCount;
                    }
                    this.DivCount = 0;
                    this.RowsCount = 0;
                }
            }
            this.VisualLocationCrated(ZoneList);
        }

        private string TdTop(int Tier)
        {
            StringBuilder strTop = new StringBuilder();
            strTop.Append("<td class=\"stereo_topleft\"></td>");
            for (int i = 0; Tier > i; i++)
            {
                strTop.Append(" <td class=\"stereo_topbg\"></td>  ");
                if (Tier != (i + 1))
                {
                    strTop.Append("<td class=\"stereo_linetopbg\"></td>");
                }
                else
                {
                    strTop.Append(" <td class=\"stereo_topright\"></td>");
                }
            }
            return strTop.ToString();
        }

        private string TierHtmlCreate(List<VisualLocationInfo> VisualLocation)
        {
            List<string> StrTierList = new List<string>();
            StringBuilder strTierHtml = new StringBuilder();
            foreach (VisualLocationInfo info in VisualLocation)
            {
                string StrTierInfo = this.LocSplit(info.Loc, "Tier");
                bool IsExist = false;
                for (int i = 0; StrTierList.Count > i; i++)
                {
                    if (StrTierInfo == StrTierList[i])
                    {
                        IsExist = true;
                        break;
                    }
                }
                if (!IsExist)
                {
                    StringBuilder strTierValue = new StringBuilder();
                    strTierValue.Append("<tr>");
                    strTierValue.AppendFormat(" <td width=\"20\" align=\"center\">{0}</td>{1}", StrTierInfo, this.RowHtmlCreate(VisualLocation.FindAll(x => this.LocSplit(x.Loc, "Tier") == StrTierInfo), this.RowsMax(VisualLocation)));
                    strTierValue.Append("</tr>");
                    StrTierList.Add(StrTierInfo);
                    this.TierCount++;
                    strTierHtml.Insert(0, strTierValue.ToString());
                }
            }
            return strTierHtml.ToString();
        }

        private void VisualLocationCrated(List<string> ZoneList)
        {
            int i;
            StringBuilder strHtml = new StringBuilder();
            int tbWidth = 0;
            if (this.ShowEffect != "Solid")
            {
                if (this.SequenceNumber > 0x63)
                {
                    this.SequenceNumber = 0x63;
                }
                tbWidth = ((this.SequenceNumber + 2) * 20) + 10;
                strHtml.AppendFormat("<table width=\"{0}px\" border=0><td  style=\"width:25px\">&nbsp;</td><td  style=\"width:25px\">&nbsp;</td>", tbWidth);
                for (i = 0; this.SequenceNumber > i; i++)
                {
                    string num = (i + 1).ToString();
                    if (num.Length < 2)
                    {
                        num = "0" + num;
                    }
                    strHtml.AppendFormat("<td  style=\"width:20px; font-size:10pt\">{0}</td>", num);
                    if (i == 0x63)
                    {
                        break;
                    }
                }
            }
            strHtml.Append("</table>");
            for (i = 0; ZoneList.Count > i; i++)
            {
                strHtml.AppendFormat("{0}", ZoneList[i]);
            }
            strHtml.Append("    <br />  <br />");
            this.AssignFunctionResponse(this.strZoneColor.ToString() + "@_@" + strHtml.ToString());
        }

        private void ZoneHtmlCreate(List<VisualLocationInfo> VisualLocation)
        {
            string StrZoneName = "";
            List<string> ZoneList = new List<string>();
            foreach (VisualLocationInfo info in VisualLocation)
            {
                if (info.ZoneID != StrZoneName)
                {
                    StrZoneName = info.ZoneID;
                    StringBuilder ZoneHtml = new StringBuilder();
                    ZoneHtml.AppendFormat("  <div style=\"width:@ZoneWidthpx  ;margin-bottom:4px \" class=\"{0}\"> ", this.SelectColor(info.ZoneID));
                    ZoneHtml.AppendFormat("{0}", this.LocationHtmlCreate(VisualLocation.FindAll(x => x.ZoneID == StrZoneName)));
                    ZoneHtml.Append("</div>");
                    ZoneHtml.Replace("@ZoneWidth", ((this.DivCount + 2) * 20).ToString());
                    ZoneList.Add(ZoneHtml.ToString());
                    if (this.SequenceNumber < this.DivCount)
                    {
                        this.SequenceNumber = this.DivCount;
                    }
                    this.DivCount = 0;
                    this.RowsCount = 0;
                }
            }
            this.VisualLocationCrated(ZoneList);
        }
    }
}

